package com.fywsy.fyweb.repository;

import com.fywsy.fyweb.entity.Category;
import com.fywsy.fyweb.entity.Game;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

@Repository
public interface CategoryRepository extends JpaRepository<Category,Long> {

    List<Category> findAllByOrderByViewsDesc();

    Category findFirstByName(String name);

    boolean existsByName(String name);

    List<Category> findByNameInOrderByViewsDesc(Set<String> names);
}